local skel = fk.CreateSkill{
  name = "ofl__duanshi",
  tags = { Skill.Compulsory, Skill.MainPlace }
}
local H = require "packages/hegemony/util"
---@type TrigSkelSpec<DeathTrigFunc>
local duanshi = {
  anim_type = "control",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(self) and (data.damage or {}).from then
      if target ~= player then
        local killer = data.damage.from
        return H.compareKingdomWith(player, target) and not H.compareKingdomWith(target, killer)
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local killer = data.damage.from
    if killer then
      killer:drawCards(H.getSameKingdomPlayersNum(room, target), "kill")
      player:drawCards(1, self.name)
      return true
    end
  end,
}
skel:addEffect(fk.Deathed, duanshi)
return skel